package com.it.controller;

import com.it.util.MinioUtil;
import com.it.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
public class UploadController {

    @Autowired
    private MinioUtil minioUtil;

    @PostMapping("/upload")
    public Result<String> upload(MultipartFile image){
        String fileUrl = minioUtil.uploadFile(image);
        return Result.success(fileUrl);
    }
}
